home *** CD-ROM | disk | FTP | other *** search
/ Medabots Cardz / Medabots CD Cardz Sumilidon.bin / mac / assets / sumilidon.dxr / 00296_Script_296 < prev    next >
Text File  |  2001-12-07  |  1KB  |  27 lines

  1. property myFile, squam, startof
  2. global beginscore
  3.  
  4. on beginsprite me
  5.   set the floatPrecision = 0
  6.   squam = getOSdirectory()&"\"
  7.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  8.   myFile = new(xtra "fileio") -- Create an instance of FileIO
  9.   --  openFile(myFile,the moviePath&"info.txt",1) --Open the file with read access
  10.   openFile(myFile,squam&"infos.txt",0) --Open the file with read access
  11.   myVariable = readFile(myFile) --set the variable 'myVariable' to the text of the file 'info.txt'
  12.   if readFile(myFile)=VOID then --checks to see if this file exists
  13.     createFile (myFile, squam&"infos.txt")
  14.     openFile(myFile,squam&"infos.txt",0)
  15.     beginscore = 100
  16.     startof = 0
  17.         put startof into member("holdscore")  
  18.         mySaveString = member("holdscore").text
  19.         writeString(myFile,mySaveString)
  20.   else
  21.     beginscore = 0
  22.     closeFile(myFile) -- Close the file
  23.   end if
  24.   myFile = 0 -- Dispose of the instance
  25.   
  26. end
  27.